package cn.lili.modules.share.serviceimpl;

import cn.lili.modules.share.entity.docs.AppJilu;
import cn.lili.modules.share.mapper.AppJiluMapper;
import cn.lili.modules.share.service.AppJiluService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author admin
 * @since 2024-03-21
 */
@Service
public class AppJiluServiceImpl extends ServiceImpl<AppJiluMapper, AppJilu> implements AppJiluService {


    /**
     * 记录推广记录
     * @param parentOpenid
     * @param subMobile
     * @return
     */
    @Override
    public boolean saveShareRecords(String parentOpenid, String subMobile) {
        AppJilu appJilu = new AppJilu();
        appJilu.setT_uid(parentOpenid);
        appJilu.setUid(subMobile);
        appJilu.setCtime((int) (System.currentTimeMillis() / 1000));
        return baseMapper.insert(appJilu) > 0;
    }
}
